import json
from ronglian_sms_sdk import SmsSDK
accId = '8aaf07087beda653017bf7aac39e0001'
accToken = '0d9ef0964b0d425f98a0ab3a277c5609'
appId = '8aaf07087beda653017bf7aac62b0008'

def send_message(mobile, code, time):
    sdk = SmsSDK(accId, accToken, appId)
    tid = "1"
    mobile = mobile
    datas = (code, time)
    resp = sdk.sendMessage(tid, mobile, datas)
    result = json.loads(resp)
    if result['statusCode'] == "000000":
        return True
    return False


# redis连接
def get_redis():
    from django_redis import get_redis_connection
    conn = get_redis_connection()
    return conn
